
using System;
using System.Collections;
using Microsoft.BizTalk.Bam.EventObservation;

namespace GenerateTypedBamApi
{
  [Serializable]
  public class DirectESApi
  {
    #region A collection of the activities defined
    
    public struct Activities
    {
      public const string CLM_837I = "CLM_837I";
      public const string CLM_835 = "CLM_835";
      public const string EB_270 = "EB_270";
      public const string EB_271 = "EB_271";
      public const string EB_270_Details = "EB_270_Details";
      public const string EB_271_Details = "EB_271_Details";
      public const string Availity_Realtime_Messaging = "Availity_Realtime_Messaging";
      public const string Availity_Realtime_Messaging_PayerErrors = "Availity_Realtime_Messaging_PayerErrors";
      public const string ClaimMessagingStatistics = "ClaimMessagingStatistics";
      public const string EDI_Correlation = "EDI_Correlation";
      public const string EDI_Envelope_Interchange = "EDI_Envelope_Interchange";
      public const string EDI_Envelope_Group = "EDI_Envelope_Group";
      public const string EDI_Envelope_Transaction = "EDI_Envelope_Transaction";
      public const string MessageLog = "MessageLog";
    }
    
    #endregion
  
    
    #region Helper class for the CLM_837I BAM activity
  
    public class CLM_837I
    {
      public CLM_837I(string CLM_837IID)
      {
        _CLM_837IID = CLM_837IID;
      } 

      public string ActivityID
      {
        get { return _CLM_837IID; }
      }	

      // Begin the CLM_837I BAM activity
      public void BeginCLM_837IActivity()
      {			
        // Begin the Activity using the passed identifier
        DirectEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_CLM_837IID);
        
      }

      // Write any data changes to the _CLM_837I activity
      // This must be called post any property changes
      public void CommitCLM_837IActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        DirectEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_CLM_837IID,al.ToArray() );	
              
      }

      // End the CLM_837I BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndCLM_837IActivity()
      {
        // End this activity, no more data can be added.
        DirectEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_CLM_837IID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_CLM_837IID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_CLM_837IID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public DateTime ReceiveClaim
      {
        set { _activityItemHashtable.Add(ReceiveClaimBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[ReceiveClaimBAMFieldName]; }
      }

      public const string ReceiveClaimBAMFieldName = "ReceiveClaim";
 
      public decimal TotalClaimCharge
      {
        set { _activityItemHashtable.Add(TotalClaimChargeBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[TotalClaimChargeBAMFieldName]; }
      }

      public const string TotalClaimChargeBAMFieldName = "TotalClaimCharge";
 
      public string InterchangeControlNumber
      {
        set { _activityItemHashtable.Add(InterchangeControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InterchangeControlNumberBAMFieldName]; }
      }

      public const string InterchangeControlNumberBAMFieldName = "InterchangeControlNumber";
 
      public string PatientAccountNumber
      {
        set { _activityItemHashtable.Add(PatientAccountNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[PatientAccountNumberBAMFieldName]; }
      }

      public const string PatientAccountNumberBAMFieldName = "PatientAccountNumber";
 
      public string SubscriberPrimaryIdentifier
      {
        set { _activityItemHashtable.Add(SubscriberPrimaryIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SubscriberPrimaryIdentifierBAMFieldName]; }
      }

      public const string SubscriberPrimaryIdentifierBAMFieldName = "SubscriberPrimaryIdentifier";
 
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string PayerIdentifier
      {
        set { _activityItemHashtable.Add(PayerIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[PayerIdentifierBAMFieldName]; }
      }

      public const string PayerIdentifierBAMFieldName = "PayerIdentifier";
 
      public string CommunicationMethod
      {
        set { _activityItemHashtable.Add(CommunicationMethodBAMFieldName,value); }
        get { return (string)_activityItemHashtable[CommunicationMethodBAMFieldName]; }
      }

      public const string CommunicationMethodBAMFieldName = "CommunicationMethod";
 
      public string IsDependent
      {
        set { _activityItemHashtable.Add(IsDependentBAMFieldName,value); }
        get { return (string)_activityItemHashtable[IsDependentBAMFieldName]; }
      }

      public const string IsDependentBAMFieldName = "IsDependent";
 
      public string IndividualRelationshipCode
      {
        set { _activityItemHashtable.Add(IndividualRelationshipCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[IndividualRelationshipCodeBAMFieldName]; }
      }

      public const string IndividualRelationshipCodeBAMFieldName = "IndividualRelationshipCode";
 
      public string RoutedTo
      {
        set { _activityItemHashtable.Add(RoutedToBAMFieldName,value); }
        get { return (string)_activityItemHashtable[RoutedToBAMFieldName]; }
      }

      public const string RoutedToBAMFieldName = "RoutedTo";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public string InterchangeTime
      {
        set { _activityItemHashtable.Add(InterchangeTimeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InterchangeTimeBAMFieldName]; }
      }

      public const string InterchangeTimeBAMFieldName = "InterchangeTime";
 
      public DateTime InterchangeDate
      {
        set { _activityItemHashtable.Add(InterchangeDateBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[InterchangeDateBAMFieldName]; }
      }

      public const string InterchangeDateBAMFieldName = "InterchangeDate";
 
      public string SubscriberFirstName
      {
        set { _activityItemHashtable.Add(SubscriberFirstNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SubscriberFirstNameBAMFieldName]; }
      }

      public const string SubscriberFirstNameBAMFieldName = "SubscriberFirstName";
 
      public string SubscriberLastName
      {
        set { _activityItemHashtable.Add(SubscriberLastNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SubscriberLastNameBAMFieldName]; }
      }

      public const string SubscriberLastNameBAMFieldName = "SubscriberLastName";
 
      public const string ActivityName = "CLM_837I";
      private string _CLM_837IID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the CLM_835 BAM activity
  
    public class CLM_835
    {
      public CLM_835(string CLM_835ID)
      {
        _CLM_835ID = CLM_835ID;
      } 

      public string ActivityID
      {
        get { return _CLM_835ID; }
      }	

      // Begin the CLM_835 BAM activity
      public void BeginCLM_835Activity()
      {			
        // Begin the Activity using the passed identifier
        DirectEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_CLM_835ID);
        
      }

      // Write any data changes to the _CLM_835 activity
      // This must be called post any property changes
      public void CommitCLM_835Activity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        DirectEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_CLM_835ID,al.ToArray() );	
              
      }

      // End the CLM_835 BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndCLM_835Activity()
      {
        // End this activity, no more data can be added.
        DirectEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_CLM_835ID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_CLM_835ID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_CLM_835ID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public DateTime ReceiveClaimPayment
      {
        set { _activityItemHashtable.Add(ReceiveClaimPaymentBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[ReceiveClaimPaymentBAMFieldName]; }
      }

      public const string ReceiveClaimPaymentBAMFieldName = "ReceiveClaimPayment";
 
      public string PatientAccountNumber
      {
        set { _activityItemHashtable.Add(PatientAccountNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[PatientAccountNumberBAMFieldName]; }
      }

      public const string PatientAccountNumberBAMFieldName = "PatientAccountNumber";
 
      public string SubscriberID
      {
        set { _activityItemHashtable.Add(SubscriberIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SubscriberIDBAMFieldName]; }
      }

      public const string SubscriberIDBAMFieldName = "SubscriberID";
 
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public decimal TotalActualProviderPaymentAmount
      {
        set { _activityItemHashtable.Add(TotalActualProviderPaymentAmountBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[TotalActualProviderPaymentAmountBAMFieldName]; }
      }

      public const string TotalActualProviderPaymentAmountBAMFieldName = "TotalActualProviderPaymentAmount";
 
      public string PayerIdentifier
      {
        set { _activityItemHashtable.Add(PayerIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[PayerIdentifierBAMFieldName]; }
      }

      public const string PayerIdentifierBAMFieldName = "PayerIdentifier";
 
      public decimal TotalCoveredChargeAmount
      {
        set { _activityItemHashtable.Add(TotalCoveredChargeAmountBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[TotalCoveredChargeAmountBAMFieldName]; }
      }

      public const string TotalCoveredChargeAmountBAMFieldName = "TotalCoveredChargeAmount";
 
      public decimal TotalNonCoveredChargeAmount
      {
        set { _activityItemHashtable.Add(TotalNonCoveredChargeAmountBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[TotalNonCoveredChargeAmountBAMFieldName]; }
      }

      public const string TotalNonCoveredChargeAmountBAMFieldName = "TotalNonCoveredChargeAmount";
 
      public decimal TotalDeniedChargeAmount
      {
        set { _activityItemHashtable.Add(TotalDeniedChargeAmountBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[TotalDeniedChargeAmountBAMFieldName]; }
      }

      public const string TotalDeniedChargeAmountBAMFieldName = "TotalDeniedChargeAmount";
 
      public decimal TotalClaimChargeAmount
      {
        set { _activityItemHashtable.Add(TotalClaimChargeAmountBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[TotalClaimChargeAmountBAMFieldName]; }
      }

      public const string TotalClaimChargeAmountBAMFieldName = "TotalClaimChargeAmount";
 
      public string InterchangeControlNumber
      {
        set { _activityItemHashtable.Add(InterchangeControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InterchangeControlNumberBAMFieldName]; }
      }

      public const string InterchangeControlNumberBAMFieldName = "InterchangeControlNumber";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public string IsDependent
      {
        set { _activityItemHashtable.Add(IsDependentBAMFieldName,value); }
        get { return (string)_activityItemHashtable[IsDependentBAMFieldName]; }
      }

      public const string IsDependentBAMFieldName = "IsDependent";
 
      public string PatientIdentifier
      {
        set { _activityItemHashtable.Add(PatientIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[PatientIdentifierBAMFieldName]; }
      }

      public const string PatientIdentifierBAMFieldName = "PatientIdentifier";
 
      public string InterchangeTime
      {
        set { _activityItemHashtable.Add(InterchangeTimeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InterchangeTimeBAMFieldName]; }
      }

      public const string InterchangeTimeBAMFieldName = "InterchangeTime";
 
      public DateTime InterchangeDate
      {
        set { _activityItemHashtable.Add(InterchangeDateBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[InterchangeDateBAMFieldName]; }
      }

      public const string InterchangeDateBAMFieldName = "InterchangeDate";
 
      public const string ActivityName = "CLM_835";
      private string _CLM_835ID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the EB_270 BAM activity
  
    public class EB_270
    {
      public EB_270(string EB_270ID)
      {
        _EB_270ID = EB_270ID;
      } 

      public string ActivityID
      {
        get { return _EB_270ID; }
      }	

      // Begin the EB_270 BAM activity
      public void BeginEB_270Activity()
      {			
        // Begin the Activity using the passed identifier
        DirectEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_EB_270ID);
        
      }

      // Write any data changes to the _EB_270 activity
      // This must be called post any property changes
      public void CommitEB_270Activity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        DirectEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_EB_270ID,al.ToArray() );	
              
      }

      // End the EB_270 BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndEB_270Activity()
      {
        // End this activity, no more data can be added.
        DirectEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_EB_270ID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EB_270ID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EB_270ID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string SourceEntityIdentifierCode
      {
        set { _activityItemHashtable.Add(SourceEntityIdentifierCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SourceEntityIdentifierCodeBAMFieldName]; }
      }

      public const string SourceEntityIdentifierCodeBAMFieldName = "SourceEntityIdentifierCode";
 
      public string SourceLastOrOrganizationName
      {
        set { _activityItemHashtable.Add(SourceLastOrOrganizationNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SourceLastOrOrganizationNameBAMFieldName]; }
      }

      public const string SourceLastOrOrganizationNameBAMFieldName = "SourceLastOrOrganizationName";
 
      public string SourcePrimaryIdentifier
      {
        set { _activityItemHashtable.Add(SourcePrimaryIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SourcePrimaryIdentifierBAMFieldName]; }
      }

      public const string SourcePrimaryIdentifierBAMFieldName = "SourcePrimaryIdentifier";
 
      public string ReceiverEntityIdentifierCode
      {
        set { _activityItemHashtable.Add(ReceiverEntityIdentifierCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ReceiverEntityIdentifierCodeBAMFieldName]; }
      }

      public const string ReceiverEntityIdentifierCodeBAMFieldName = "ReceiverEntityIdentifierCode";
 
      public string ReceiverEntityTypeQualifier
      {
        set { _activityItemHashtable.Add(ReceiverEntityTypeQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ReceiverEntityTypeQualifierBAMFieldName]; }
      }

      public const string ReceiverEntityTypeQualifierBAMFieldName = "ReceiverEntityTypeQualifier";
 
      public string ReceiverLastOrOrganizationName
      {
        set { _activityItemHashtable.Add(ReceiverLastOrOrganizationNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ReceiverLastOrOrganizationNameBAMFieldName]; }
      }

      public const string ReceiverLastOrOrganizationNameBAMFieldName = "ReceiverLastOrOrganizationName";
 
      public string ReceiverIdentificationNumber
      {
        set { _activityItemHashtable.Add(ReceiverIdentificationNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ReceiverIdentificationNumberBAMFieldName]; }
      }

      public const string ReceiverIdentificationNumberBAMFieldName = "ReceiverIdentificationNumber";
 
      public string ReceiverReferenceIdentificationQualifier
      {
        set { _activityItemHashtable.Add(ReceiverReferenceIdentificationQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ReceiverReferenceIdentificationQualifierBAMFieldName]; }
      }

      public const string ReceiverReferenceIdentificationQualifierBAMFieldName = "ReceiverReferenceIdentificationQualifier";
 
      public string ReceiverAdditionalIdentifier
      {
        set { _activityItemHashtable.Add(ReceiverAdditionalIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ReceiverAdditionalIdentifierBAMFieldName]; }
      }

      public const string ReceiverAdditionalIdentifierBAMFieldName = "ReceiverAdditionalIdentifier";
 
      public string LicenseNumberStateCode
      {
        set { _activityItemHashtable.Add(LicenseNumberStateCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[LicenseNumberStateCodeBAMFieldName]; }
      }

      public const string LicenseNumberStateCodeBAMFieldName = "LicenseNumberStateCode";
 
      public string TraceNumber
      {
        set { _activityItemHashtable.Add(TraceNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[TraceNumberBAMFieldName]; }
      }

      public const string TraceNumberBAMFieldName = "TraceNumber";
 
      public string TraceAssigningEntityIdentifier
      {
        set { _activityItemHashtable.Add(TraceAssigningEntityIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[TraceAssigningEntityIdentifierBAMFieldName]; }
      }

      public const string TraceAssigningEntityIdentifierBAMFieldName = "TraceAssigningEntityIdentifier";
 
      public string TraceAssigningEntityAdditionalIdentifier
      {
        set { _activityItemHashtable.Add(TraceAssigningEntityAdditionalIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[TraceAssigningEntityAdditionalIdentifierBAMFieldName]; }
      }

      public const string TraceAssigningEntityAdditionalIdentifierBAMFieldName = "TraceAssigningEntityAdditionalIdentifier";
 
      public string SubscriberDependentLastName
      {
        set { _activityItemHashtable.Add(SubscriberDependentLastNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SubscriberDependentLastNameBAMFieldName]; }
      }

      public const string SubscriberDependentLastNameBAMFieldName = "SubscriberDependentLastName";
 
      public string SubscriberDependentFirstName
      {
        set { _activityItemHashtable.Add(SubscriberDependentFirstNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SubscriberDependentFirstNameBAMFieldName]; }
      }

      public const string SubscriberDependentFirstNameBAMFieldName = "SubscriberDependentFirstName";
 
      public string SubscriberPrimaryIdentifier
      {
        set { _activityItemHashtable.Add(SubscriberPrimaryIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SubscriberPrimaryIdentifierBAMFieldName]; }
      }

      public const string SubscriberPrimaryIdentifierBAMFieldName = "SubscriberPrimaryIdentifier";
 
      public string IsDependent
      {
        set { _activityItemHashtable.Add(IsDependentBAMFieldName,value); }
        get { return (string)_activityItemHashtable[IsDependentBAMFieldName]; }
      }

      public const string IsDependentBAMFieldName = "IsDependent";
 
      public DateTime SendRequest
      {
        set { _activityItemHashtable.Add(SendRequestBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[SendRequestBAMFieldName]; }
      }

      public const string SendRequestBAMFieldName = "SendRequest";
 
      public string ProviderCode
      {
        set { _activityItemHashtable.Add(ProviderCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ProviderCodeBAMFieldName]; }
      }

      public const string ProviderCodeBAMFieldName = "ProviderCode";
 
      public string ProviderIdentifier
      {
        set { _activityItemHashtable.Add(ProviderIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ProviderIdentifierBAMFieldName]; }
      }

      public const string ProviderIdentifierBAMFieldName = "ProviderIdentifier";
 
      public string SubmitterTransactionIdentifier
      {
        set { _activityItemHashtable.Add(SubmitterTransactionIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SubmitterTransactionIdentifierBAMFieldName]; }
      }

      public const string SubmitterTransactionIdentifierBAMFieldName = "SubmitterTransactionIdentifier";
 
      public string CommunicationMethod
      {
        set { _activityItemHashtable.Add(CommunicationMethodBAMFieldName,value); }
        get { return (string)_activityItemHashtable[CommunicationMethodBAMFieldName]; }
      }

      public const string CommunicationMethodBAMFieldName = "CommunicationMethod";
 
      public string RoutedTo
      {
        set { _activityItemHashtable.Add(RoutedToBAMFieldName,value); }
        get { return (string)_activityItemHashtable[RoutedToBAMFieldName]; }
      }

      public const string RoutedToBAMFieldName = "RoutedTo";
 
      public string InterchangeControlNumber
      {
        set { _activityItemHashtable.Add(InterchangeControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InterchangeControlNumberBAMFieldName]; }
      }

      public const string InterchangeControlNumberBAMFieldName = "InterchangeControlNumber";
 
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public string InterchangeTime
      {
        set { _activityItemHashtable.Add(InterchangeTimeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InterchangeTimeBAMFieldName]; }
      }

      public const string InterchangeTimeBAMFieldName = "InterchangeTime";
 
      public DateTime InterchangeDate
      {
        set { _activityItemHashtable.Add(InterchangeDateBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[InterchangeDateBAMFieldName]; }
      }

      public const string InterchangeDateBAMFieldName = "InterchangeDate";
 
      public const string ActivityName = "EB_270";
      private string _EB_270ID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the EB_271 BAM activity
  
    public class EB_271
    {
      public EB_271(string EB_271ID)
      {
        _EB_271ID = EB_271ID;
      } 

      public string ActivityID
      {
        get { return _EB_271ID; }
      }	

      // Begin the EB_271 BAM activity
      public void BeginEB_271Activity()
      {			
        // Begin the Activity using the passed identifier
        DirectEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_EB_271ID);
        
      }

      // Write any data changes to the _EB_271 activity
      // This must be called post any property changes
      public void CommitEB_271Activity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        DirectEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_EB_271ID,al.ToArray() );	
              
      }

      // End the EB_271 BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndEB_271Activity()
      {
        // End this activity, no more data can be added.
        DirectEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_EB_271ID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EB_271ID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EB_271ID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string InformationSourcePrimaryIdentifier
      {
        set { _activityItemHashtable.Add(InformationSourcePrimaryIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InformationSourcePrimaryIdentifierBAMFieldName]; }
      }

      public const string InformationSourcePrimaryIdentifierBAMFieldName = "InformationSourcePrimaryIdentifier";
 
      public string PlanName
      {
        set { _activityItemHashtable.Add(PlanNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[PlanNameBAMFieldName]; }
      }

      public const string PlanNameBAMFieldName = "PlanName";
 
      public string TraceTypeCode
      {
        set { _activityItemHashtable.Add(TraceTypeCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[TraceTypeCodeBAMFieldName]; }
      }

      public const string TraceTypeCodeBAMFieldName = "TraceTypeCode";
 
      public string TraceNumber
      {
        set { _activityItemHashtable.Add(TraceNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[TraceNumberBAMFieldName]; }
      }

      public const string TraceNumberBAMFieldName = "TraceNumber";
 
      public string TraceAssigningEntityIdentifier
      {
        set { _activityItemHashtable.Add(TraceAssigningEntityIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[TraceAssigningEntityIdentifierBAMFieldName]; }
      }

      public const string TraceAssigningEntityIdentifierBAMFieldName = "TraceAssigningEntityIdentifier";
 
      public string TraceAssigningEntityAdditionalIdentifier
      {
        set { _activityItemHashtable.Add(TraceAssigningEntityAdditionalIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[TraceAssigningEntityAdditionalIdentifierBAMFieldName]; }
      }

      public const string TraceAssigningEntityAdditionalIdentifierBAMFieldName = "TraceAssigningEntityAdditionalIdentifier";
 
      public string SubscriberPrimaryIdentifier
      {
        set { _activityItemHashtable.Add(SubscriberPrimaryIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SubscriberPrimaryIdentifierBAMFieldName]; }
      }

      public const string SubscriberPrimaryIdentifierBAMFieldName = "SubscriberPrimaryIdentifier";
 
      public string IsDependent
      {
        set { _activityItemHashtable.Add(IsDependentBAMFieldName,value); }
        get { return (string)_activityItemHashtable[IsDependentBAMFieldName]; }
      }

      public const string IsDependentBAMFieldName = "IsDependent";
 
      public DateTime ReceiveResponse
      {
        set { _activityItemHashtable.Add(ReceiveResponseBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[ReceiveResponseBAMFieldName]; }
      }

      public const string ReceiveResponseBAMFieldName = "ReceiveResponse";
 
      public string SubscriberSupplementalIdentifier
      {
        set { _activityItemHashtable.Add(SubscriberSupplementalIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SubscriberSupplementalIdentifierBAMFieldName]; }
      }

      public const string SubscriberSupplementalIdentifierBAMFieldName = "SubscriberSupplementalIdentifier";
 
      public string PlanSponsorName
      {
        set { _activityItemHashtable.Add(PlanSponsorNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[PlanSponsorNameBAMFieldName]; }
      }

      public const string PlanSponsorNameBAMFieldName = "PlanSponsorName";
 
      public string ValidRequestIndicator
      {
        set { _activityItemHashtable.Add(ValidRequestIndicatorBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ValidRequestIndicatorBAMFieldName]; }
      }

      public const string ValidRequestIndicatorBAMFieldName = "ValidRequestIndicator";
 
      public string RejectReasonCode
      {
        set { _activityItemHashtable.Add(RejectReasonCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[RejectReasonCodeBAMFieldName]; }
      }

      public const string RejectReasonCodeBAMFieldName = "RejectReasonCode";
 
      public string FollowupActionCode
      {
        set { _activityItemHashtable.Add(FollowupActionCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[FollowupActionCodeBAMFieldName]; }
      }

      public const string FollowupActionCodeBAMFieldName = "FollowupActionCode";
 
      public string SubmitterTransactionIdentifier
      {
        set { _activityItemHashtable.Add(SubmitterTransactionIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SubmitterTransactionIdentifierBAMFieldName]; }
      }

      public const string SubmitterTransactionIdentifierBAMFieldName = "SubmitterTransactionIdentifier";
 
      public string SourcePrimaryIdentifier
      {
        set { _activityItemHashtable.Add(SourcePrimaryIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SourcePrimaryIdentifierBAMFieldName]; }
      }

      public const string SourcePrimaryIdentifierBAMFieldName = "SourcePrimaryIdentifier";
 
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public string InterchangeTime
      {
        set { _activityItemHashtable.Add(InterchangeTimeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InterchangeTimeBAMFieldName]; }
      }

      public const string InterchangeTimeBAMFieldName = "InterchangeTime";
 
      public DateTime InterchangeDate
      {
        set { _activityItemHashtable.Add(InterchangeDateBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[InterchangeDateBAMFieldName]; }
      }

      public const string InterchangeDateBAMFieldName = "InterchangeDate";
 
      public string InterchangeControlNumber
      {
        set { _activityItemHashtable.Add(InterchangeControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InterchangeControlNumberBAMFieldName]; }
      }

      public const string InterchangeControlNumberBAMFieldName = "InterchangeControlNumber";
 
      public const string ActivityName = "EB_271";
      private string _EB_271ID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the EB_270_Details BAM activity
  
    public class EB_270_Details
    {
      public EB_270_Details(string EB_270_DetailsID)
      {
        _EB_270_DetailsID = EB_270_DetailsID;
      } 

      public string ActivityID
      {
        get { return _EB_270_DetailsID; }
      }	

      // Begin the EB_270_Details BAM activity
      public void BeginEB_270_DetailsActivity()
      {			
        // Begin the Activity using the passed identifier
        DirectEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_EB_270_DetailsID);
        
      }

      // Write any data changes to the _EB_270_Details activity
      // This must be called post any property changes
      public void CommitEB_270_DetailsActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        DirectEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_EB_270_DetailsID,al.ToArray() );	
              
      }

      // End the EB_270_Details BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndEB_270_DetailsActivity()
      {
        // End this activity, no more data can be added.
        DirectEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_EB_270_DetailsID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EB_270_DetailsID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EB_270_DetailsID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string TraceNumber
      {
        set { _activityItemHashtable.Add(TraceNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[TraceNumberBAMFieldName]; }
      }

      public const string TraceNumberBAMFieldName = "TraceNumber";
 
      public string ServiceTypeCode
      {
        set { _activityItemHashtable.Add(ServiceTypeCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ServiceTypeCodeBAMFieldName]; }
      }

      public const string ServiceTypeCodeBAMFieldName = "ServiceTypeCode";
 
      public string ProductOrServiceIDQualifier
      {
        set { _activityItemHashtable.Add(ProductOrServiceIDQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ProductOrServiceIDQualifierBAMFieldName]; }
      }

      public const string ProductOrServiceIDQualifierBAMFieldName = "ProductOrServiceIDQualifier";
 
      public string ProcedureCode
      {
        set { _activityItemHashtable.Add(ProcedureCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ProcedureCodeBAMFieldName]; }
      }

      public const string ProcedureCodeBAMFieldName = "ProcedureCode";
 
      public string ProcedureModifier1
      {
        set { _activityItemHashtable.Add(ProcedureModifier1BAMFieldName,value); }
        get { return (string)_activityItemHashtable[ProcedureModifier1BAMFieldName]; }
      }

      public const string ProcedureModifier1BAMFieldName = "ProcedureModifier1";
 
      public string ProcedureModifier2
      {
        set { _activityItemHashtable.Add(ProcedureModifier2BAMFieldName,value); }
        get { return (string)_activityItemHashtable[ProcedureModifier2BAMFieldName]; }
      }

      public const string ProcedureModifier2BAMFieldName = "ProcedureModifier2";
 
      public string ProcedureModifier3
      {
        set { _activityItemHashtable.Add(ProcedureModifier3BAMFieldName,value); }
        get { return (string)_activityItemHashtable[ProcedureModifier3BAMFieldName]; }
      }

      public const string ProcedureModifier3BAMFieldName = "ProcedureModifier3";
 
      public string ProcedureModifier4
      {
        set { _activityItemHashtable.Add(ProcedureModifier4BAMFieldName,value); }
        get { return (string)_activityItemHashtable[ProcedureModifier4BAMFieldName]; }
      }

      public const string ProcedureModifier4BAMFieldName = "ProcedureModifier4";
 
      public string BenefitCoverageLevelCode
      {
        set { _activityItemHashtable.Add(BenefitCoverageLevelCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitCoverageLevelCodeBAMFieldName]; }
      }

      public const string BenefitCoverageLevelCodeBAMFieldName = "BenefitCoverageLevelCode";
 
      public string InsuranceTypeCode
      {
        set { _activityItemHashtable.Add(InsuranceTypeCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InsuranceTypeCodeBAMFieldName]; }
      }

      public const string InsuranceTypeCodeBAMFieldName = "InsuranceTypeCode";
 
      public string AmountQualifierCode
      {
        set { _activityItemHashtable.Add(AmountQualifierCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AmountQualifierCodeBAMFieldName]; }
      }

      public const string AmountQualifierCodeBAMFieldName = "AmountQualifierCode";
 
      public decimal SpendDownAmount
      {
        set { _activityItemHashtable.Add(SpendDownAmountBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[SpendDownAmountBAMFieldName]; }
      }

      public const string SpendDownAmountBAMFieldName = "SpendDownAmount";
 
      public string CodeListQualifierCode
      {
        set { _activityItemHashtable.Add(CodeListQualifierCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[CodeListQualifierCodeBAMFieldName]; }
      }

      public const string CodeListQualifierCodeBAMFieldName = "CodeListQualifierCode";
 
      public string IndustryCode
      {
        set { _activityItemHashtable.Add(IndustryCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[IndustryCodeBAMFieldName]; }
      }

      public const string IndustryCodeBAMFieldName = "IndustryCode";
 
      public string ReferenceIdentificationQualifier
      {
        set { _activityItemHashtable.Add(ReferenceIdentificationQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ReferenceIdentificationQualifierBAMFieldName]; }
      }

      public const string ReferenceIdentificationQualifierBAMFieldName = "ReferenceIdentificationQualifier";
 
      public string PriorAuthorizationOrReferralNumber
      {
        set { _activityItemHashtable.Add(PriorAuthorizationOrReferralNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[PriorAuthorizationOrReferralNumberBAMFieldName]; }
      }

      public const string PriorAuthorizationOrReferralNumberBAMFieldName = "PriorAuthorizationOrReferralNumber";
 
      public string DateTimeQualifier
      {
        set { _activityItemHashtable.Add(DateTimeQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[DateTimeQualifierBAMFieldName]; }
      }

      public const string DateTimeQualifierBAMFieldName = "DateTimeQualifier";
 
      public string DateTimePeriod
      {
        set { _activityItemHashtable.Add(DateTimePeriodBAMFieldName,value); }
        get { return (string)_activityItemHashtable[DateTimePeriodBAMFieldName]; }
      }

      public const string DateTimePeriodBAMFieldName = "DateTimePeriod";
 
      public string SubscriberPrimaryID
      {
        set { _activityItemHashtable.Add(SubscriberPrimaryIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SubscriberPrimaryIDBAMFieldName]; }
      }

      public const string SubscriberPrimaryIDBAMFieldName = "SubscriberPrimaryID";
 
      public string IsDependent
      {
        set { _activityItemHashtable.Add(IsDependentBAMFieldName,value); }
        get { return (string)_activityItemHashtable[IsDependentBAMFieldName]; }
      }

      public const string IsDependentBAMFieldName = "IsDependent";
 
      public const string ActivityName = "EB_270_Details";
      private string _EB_270_DetailsID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the EB_271_Details BAM activity
  
    public class EB_271_Details
    {
      public EB_271_Details(string EB_271_DetailsID)
      {
        _EB_271_DetailsID = EB_271_DetailsID;
      } 

      public string ActivityID
      {
        get { return _EB_271_DetailsID; }
      }	

      // Begin the EB_271_Details BAM activity
      public void BeginEB_271_DetailsActivity()
      {			
        // Begin the Activity using the passed identifier
        DirectEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_EB_271_DetailsID);
        
      }

      // Write any data changes to the _EB_271_Details activity
      // This must be called post any property changes
      public void CommitEB_271_DetailsActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        DirectEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_EB_271_DetailsID,al.ToArray() );	
              
      }

      // End the EB_271_Details BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndEB_271_DetailsActivity()
      {
        // End this activity, no more data can be added.
        DirectEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_EB_271_DetailsID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EB_271_DetailsID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EB_271_DetailsID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string TraceNumber
      {
        set { _activityItemHashtable.Add(TraceNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[TraceNumberBAMFieldName]; }
      }

      public const string TraceNumberBAMFieldName = "TraceNumber";
 
      public string EligibilityOrBenefitInformation
      {
        set { _activityItemHashtable.Add(EligibilityOrBenefitInformationBAMFieldName,value); }
        get { return (string)_activityItemHashtable[EligibilityOrBenefitInformationBAMFieldName]; }
      }

      public const string EligibilityOrBenefitInformationBAMFieldName = "EligibilityOrBenefitInformation";
 
      public string BenefitCoverageLevelCode
      {
        set { _activityItemHashtable.Add(BenefitCoverageLevelCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitCoverageLevelCodeBAMFieldName]; }
      }

      public const string BenefitCoverageLevelCodeBAMFieldName = "BenefitCoverageLevelCode";
 
      public string ServiceTypeCode
      {
        set { _activityItemHashtable.Add(ServiceTypeCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ServiceTypeCodeBAMFieldName]; }
      }

      public const string ServiceTypeCodeBAMFieldName = "ServiceTypeCode";
 
      public string InsuranceTypeCode
      {
        set { _activityItemHashtable.Add(InsuranceTypeCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InsuranceTypeCodeBAMFieldName]; }
      }

      public const string InsuranceTypeCodeBAMFieldName = "InsuranceTypeCode";
 
      public string PlanCoverageDescription
      {
        set { _activityItemHashtable.Add(PlanCoverageDescriptionBAMFieldName,value); }
        get { return (string)_activityItemHashtable[PlanCoverageDescriptionBAMFieldName]; }
      }

      public const string PlanCoverageDescriptionBAMFieldName = "PlanCoverageDescription";
 
      public string TimePeriodQualifier
      {
        set { _activityItemHashtable.Add(TimePeriodQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[TimePeriodQualifierBAMFieldName]; }
      }

      public const string TimePeriodQualifierBAMFieldName = "TimePeriodQualifier";
 
      public string BenefitPercent
      {
        set { _activityItemHashtable.Add(BenefitPercentBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BenefitPercentBAMFieldName]; }
      }

      public const string BenefitPercentBAMFieldName = "BenefitPercent";
 
      public decimal BenefitAmount
      {
        set { _activityItemHashtable.Add(BenefitAmountBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[BenefitAmountBAMFieldName]; }
      }

      public const string BenefitAmountBAMFieldName = "BenefitAmount";
 
      public string QuantityQualifier
      {
        set { _activityItemHashtable.Add(QuantityQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[QuantityQualifierBAMFieldName]; }
      }

      public const string QuantityQualifierBAMFieldName = "QuantityQualifier";
 
      public int BenefitQuantity
      {
        set { _activityItemHashtable.Add(BenefitQuantityBAMFieldName,value); }
        get { return (int)_activityItemHashtable[BenefitQuantityBAMFieldName]; }
      }

      public const string BenefitQuantityBAMFieldName = "BenefitQuantity";
 
      public string AuthorizationOrCertificationIndicator
      {
        set { _activityItemHashtable.Add(AuthorizationOrCertificationIndicatorBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AuthorizationOrCertificationIndicatorBAMFieldName]; }
      }

      public const string AuthorizationOrCertificationIndicatorBAMFieldName = "AuthorizationOrCertificationIndicator";
 
      public string InPlanNetworkIndicator
      {
        set { _activityItemHashtable.Add(InPlanNetworkIndicatorBAMFieldName,value); }
        get { return (string)_activityItemHashtable[InPlanNetworkIndicatorBAMFieldName]; }
      }

      public const string InPlanNetworkIndicatorBAMFieldName = "InPlanNetworkIndicator";
 
      public string ReferenceIdentificationQualifier
      {
        set { _activityItemHashtable.Add(ReferenceIdentificationQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ReferenceIdentificationQualifierBAMFieldName]; }
      }

      public const string ReferenceIdentificationQualifierBAMFieldName = "ReferenceIdentificationQualifier";
 
      public string SubscriberEligibilityOrBenefitIdentifier
      {
        set { _activityItemHashtable.Add(SubscriberEligibilityOrBenefitIdentifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SubscriberEligibilityOrBenefitIdentifierBAMFieldName]; }
      }

      public const string SubscriberEligibilityOrBenefitIdentifierBAMFieldName = "SubscriberEligibilityOrBenefitIdentifier";
 
      public string PlanSponsorName
      {
        set { _activityItemHashtable.Add(PlanSponsorNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[PlanSponsorNameBAMFieldName]; }
      }

      public const string PlanSponsorNameBAMFieldName = "PlanSponsorName";
 
      public string FreeFormMessageText
      {
        set { _activityItemHashtable.Add(FreeFormMessageTextBAMFieldName,value); }
        get { return (string)_activityItemHashtable[FreeFormMessageTextBAMFieldName]; }
      }

      public const string FreeFormMessageTextBAMFieldName = "FreeFormMessageText";
 
      public string ProcedureCode
      {
        set { _activityItemHashtable.Add(ProcedureCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ProcedureCodeBAMFieldName]; }
      }

      public const string ProcedureCodeBAMFieldName = "ProcedureCode";
 
      public string ProductOrServiceIDQualifier
      {
        set { _activityItemHashtable.Add(ProductOrServiceIDQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ProductOrServiceIDQualifierBAMFieldName]; }
      }

      public const string ProductOrServiceIDQualifierBAMFieldName = "ProductOrServiceIDQualifier";
 
      public string IsDependent
      {
        set { _activityItemHashtable.Add(IsDependentBAMFieldName,value); }
        get { return (string)_activityItemHashtable[IsDependentBAMFieldName]; }
      }

      public const string IsDependentBAMFieldName = "IsDependent";
 
      public const string ActivityName = "EB_271_Details";
      private string _EB_271_DetailsID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the Availity_Realtime_Messaging BAM activity
  
    public class Availity_Realtime_Messaging
    {
      public Availity_Realtime_Messaging(string Availity_Realtime_MessagingID)
      {
        _Availity_Realtime_MessagingID = Availity_Realtime_MessagingID;
      } 

      public string ActivityID
      {
        get { return _Availity_Realtime_MessagingID; }
      }	

      // Begin the Availity_Realtime_Messaging BAM activity
      public void BeginAvaility_Realtime_MessagingActivity()
      {			
        // Begin the Activity using the passed identifier
        DirectEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_Availity_Realtime_MessagingID);
        
      }

      // Write any data changes to the _Availity_Realtime_Messaging activity
      // This must be called post any property changes
      public void CommitAvaility_Realtime_MessagingActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        DirectEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_Availity_Realtime_MessagingID,al.ToArray() );	
              
      }

      // End the Availity_Realtime_Messaging BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndAvaility_Realtime_MessagingActivity()
      {
        // End this activity, no more data can be added.
        DirectEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_Availity_Realtime_MessagingID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_Availity_Realtime_MessagingID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_Availity_Realtime_MessagingID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string TranCode
      {
        set { _activityItemHashtable.Add(TranCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[TranCodeBAMFieldName]; }
      }

      public const string TranCodeBAMFieldName = "TranCode";
 
      public string MessageFormat
      {
        set { _activityItemHashtable.Add(MessageFormatBAMFieldName,value); }
        get { return (string)_activityItemHashtable[MessageFormatBAMFieldName]; }
      }

      public const string MessageFormatBAMFieldName = "MessageFormat";
 
      public string Sender
      {
        set { _activityItemHashtable.Add(SenderBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SenderBAMFieldName]; }
      }

      public const string SenderBAMFieldName = "Sender";
 
      public string Receiver
      {
        set { _activityItemHashtable.Add(ReceiverBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ReceiverBAMFieldName]; }
      }

      public const string ReceiverBAMFieldName = "Receiver";
 
      public string Session
      {
        set { _activityItemHashtable.Add(SessionBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SessionBAMFieldName]; }
      }

      public const string SessionBAMFieldName = "Session";
 
      public string ProviderOfficeNumber
      {
        set { _activityItemHashtable.Add(ProviderOfficeNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ProviderOfficeNumberBAMFieldName]; }
      }

      public const string ProviderOfficeNumberBAMFieldName = "ProviderOfficeNumber";
 
      public string ProviderTransactionID
      {
        set { _activityItemHashtable.Add(ProviderTransactionIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ProviderTransactionIDBAMFieldName]; }
      }

      public const string ProviderTransactionIDBAMFieldName = "ProviderTransactionID";
 
      public string BTSMessageID_HTTPRequest
      {
        set { _activityItemHashtable.Add(BTSMessageID_HTTPRequestBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageID_HTTPRequestBAMFieldName]; }
      }

      public const string BTSMessageID_HTTPRequestBAMFieldName = "BTSMessageID_HTTPRequest";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public string UniqueIdentfier
      {
        set { _activityItemHashtable.Add(UniqueIdentfierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[UniqueIdentfierBAMFieldName]; }
      }

      public const string UniqueIdentfierBAMFieldName = "UniqueIdentfier";
 
      public DateTime MessageRequestDate
      {
        set { _activityItemHashtable.Add(MessageRequestDateBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[MessageRequestDateBAMFieldName]; }
      }

      public const string MessageRequestDateBAMFieldName = "MessageRequestDate";
 
      public DateTime MessageResponseDate
      {
        set { _activityItemHashtable.Add(MessageResponseDateBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[MessageResponseDateBAMFieldName]; }
      }

      public const string MessageResponseDateBAMFieldName = "MessageResponseDate";
 
      public string ResponseMessageFormat
      {
        set { _activityItemHashtable.Add(ResponseMessageFormatBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ResponseMessageFormatBAMFieldName]; }
      }

      public const string ResponseMessageFormatBAMFieldName = "ResponseMessageFormat";
 
      public string ResponseErrorCode
      {
        set { _activityItemHashtable.Add(ResponseErrorCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ResponseErrorCodeBAMFieldName]; }
      }

      public const string ResponseErrorCodeBAMFieldName = "ResponseErrorCode";
 
      public string ResponseErrorDescription
      {
        set { _activityItemHashtable.Add(ResponseErrorDescriptionBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ResponseErrorDescriptionBAMFieldName]; }
      }

      public const string ResponseErrorDescriptionBAMFieldName = "ResponseErrorDescription";
 
      public string ResponseTransactionType
      {
        set { _activityItemHashtable.Add(ResponseTransactionTypeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ResponseTransactionTypeBAMFieldName]; }
      }

      public const string ResponseTransactionTypeBAMFieldName = "ResponseTransactionType";
 
      public string ResponseSessionID
      {
        set { _activityItemHashtable.Add(ResponseSessionIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ResponseSessionIDBAMFieldName]; }
      }

      public const string ResponseSessionIDBAMFieldName = "ResponseSessionID";
 
      public string ResponseMessageType
      {
        set { _activityItemHashtable.Add(ResponseMessageTypeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ResponseMessageTypeBAMFieldName]; }
      }

      public const string ResponseMessageTypeBAMFieldName = "ResponseMessageType";
 
      public string AXIMLSender
      {
        set { _activityItemHashtable.Add(AXIMLSenderBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLSenderBAMFieldName]; }
      }

      public const string AXIMLSenderBAMFieldName = "AXIMLSender";
 
      public string AXIMLReceiver
      {
        set { _activityItemHashtable.Add(AXIMLReceiverBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLReceiverBAMFieldName]; }
      }

      public const string AXIMLReceiverBAMFieldName = "AXIMLReceiver";
 
      public string AXIMLTransDate
      {
        set { _activityItemHashtable.Add(AXIMLTransDateBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLTransDateBAMFieldName]; }
      }

      public const string AXIMLTransDateBAMFieldName = "AXIMLTransDate";
 
      public string AXIMLTransTime
      {
        set { _activityItemHashtable.Add(AXIMLTransTimeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLTransTimeBAMFieldName]; }
      }

      public const string AXIMLTransTimeBAMFieldName = "AXIMLTransTime";
 
      public string AXIMLTestProd
      {
        set { _activityItemHashtable.Add(AXIMLTestProdBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLTestProdBAMFieldName]; }
      }

      public const string AXIMLTestProdBAMFieldName = "AXIMLTestProd";
 
      public string AXIMLTransID
      {
        set { _activityItemHashtable.Add(AXIMLTransIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLTransIDBAMFieldName]; }
      }

      public const string AXIMLTransIDBAMFieldName = "AXIMLTransID";
 
      public string AXIMLSenderTransID
      {
        set { _activityItemHashtable.Add(AXIMLSenderTransIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLSenderTransIDBAMFieldName]; }
      }

      public const string AXIMLSenderTransIDBAMFieldName = "AXIMLSenderTransID";
 
      public string AXIMLMessageText
      {
        set { _activityItemHashtable.Add(AXIMLMessageTextBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLMessageTextBAMFieldName]; }
      }

      public const string AXIMLMessageTextBAMFieldName = "AXIMLMessageText";
 
      public string AXIMLInfoReceiverOrgName
      {
        set { _activityItemHashtable.Add(AXIMLInfoReceiverOrgNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLInfoReceiverOrgNameBAMFieldName]; }
      }

      public const string AXIMLInfoReceiverOrgNameBAMFieldName = "AXIMLInfoReceiverOrgName";
 
      public string AXIMLInfoReceiverSiteID
      {
        set { _activityItemHashtable.Add(AXIMLInfoReceiverSiteIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLInfoReceiverSiteIDBAMFieldName]; }
      }

      public const string AXIMLInfoReceiverSiteIDBAMFieldName = "AXIMLInfoReceiverSiteID";
 
      public string AXIMLInfoReceiverAKAName
      {
        set { _activityItemHashtable.Add(AXIMLInfoReceiverAKANameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLInfoReceiverAKANameBAMFieldName]; }
      }

      public const string AXIMLInfoReceiverAKANameBAMFieldName = "AXIMLInfoReceiverAKAName";
 
      public string AXIMLEDIVersionNumber
      {
        set { _activityItemHashtable.Add(AXIMLEDIVersionNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLEDIVersionNumberBAMFieldName]; }
      }

      public const string AXIMLEDIVersionNumberBAMFieldName = "AXIMLEDIVersionNumber";
 
      public string AXIMLTransCode
      {
        set { _activityItemHashtable.Add(AXIMLTransCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[AXIMLTransCodeBAMFieldName]; }
      }

      public const string AXIMLTransCodeBAMFieldName = "AXIMLTransCode";
 
      public string BTSMessageID_OriginalRequest
      {
        set { _activityItemHashtable.Add(BTSMessageID_OriginalRequestBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageID_OriginalRequestBAMFieldName]; }
      }

      public const string BTSMessageID_OriginalRequestBAMFieldName = "BTSMessageID_OriginalRequest";
 
      public const string ActivityName = "Availity_Realtime_Messaging";
      private string _Availity_Realtime_MessagingID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the Availity_Realtime_Messaging_PayerErrors BAM activity
  
    public class Availity_Realtime_Messaging_PayerErrors
    {
      public Availity_Realtime_Messaging_PayerErrors(string Availity_Realtime_Messaging_PayerErrorsID)
      {
        _Availity_Realtime_Messaging_PayerErrorsID = Availity_Realtime_Messaging_PayerErrorsID;
      } 

      public string ActivityID
      {
        get { return _Availity_Realtime_Messaging_PayerErrorsID; }
      }	

      // Begin the Availity_Realtime_Messaging_PayerErrors BAM activity
      public void BeginAvaility_Realtime_Messaging_PayerErrorsActivity()
      {			
        // Begin the Activity using the passed identifier
        DirectEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_Availity_Realtime_Messaging_PayerErrorsID);
        
      }

      // Write any data changes to the _Availity_Realtime_Messaging_PayerErrors activity
      // This must be called post any property changes
      public void CommitAvaility_Realtime_Messaging_PayerErrorsActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        DirectEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_Availity_Realtime_Messaging_PayerErrorsID,al.ToArray() );	
              
      }

      // End the Availity_Realtime_Messaging_PayerErrors BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndAvaility_Realtime_Messaging_PayerErrorsActivity()
      {
        // End this activity, no more data can be added.
        DirectEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_Availity_Realtime_Messaging_PayerErrorsID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_Availity_Realtime_Messaging_PayerErrorsID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_Availity_Realtime_Messaging_PayerErrorsID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string ErrorRow
      {
        set { _activityItemHashtable.Add(ErrorRowBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ErrorRowBAMFieldName]; }
      }

      public const string ErrorRowBAMFieldName = "ErrorRow";
 
      public string ErrorCode
      {
        set { _activityItemHashtable.Add(ErrorCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ErrorCodeBAMFieldName]; }
      }

      public const string ErrorCodeBAMFieldName = "ErrorCode";
 
      public string Followup
      {
        set { _activityItemHashtable.Add(FollowupBAMFieldName,value); }
        get { return (string)_activityItemHashtable[FollowupBAMFieldName]; }
      }

      public const string FollowupBAMFieldName = "Followup";
 
      public string HIPAAText
      {
        set { _activityItemHashtable.Add(HIPAATextBAMFieldName,value); }
        get { return (string)_activityItemHashtable[HIPAATextBAMFieldName]; }
      }

      public const string HIPAATextBAMFieldName = "HIPAAText";
 
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public const string ActivityName = "Availity_Realtime_Messaging_PayerErrors";
      private string _Availity_Realtime_Messaging_PayerErrorsID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the ClaimMessagingStatistics BAM activity
  
    public class ClaimMessagingStatistics
    {
      public ClaimMessagingStatistics(string ClaimMessagingStatisticsID)
      {
        _ClaimMessagingStatisticsID = ClaimMessagingStatisticsID;
      } 

      public string ActivityID
      {
        get { return _ClaimMessagingStatisticsID; }
      }	

      // Begin the ClaimMessagingStatistics BAM activity
      public void BeginClaimMessagingStatisticsActivity()
      {			
        // Begin the Activity using the passed identifier
        DirectEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_ClaimMessagingStatisticsID);
        
      }

      // Write any data changes to the _ClaimMessagingStatistics activity
      // This must be called post any property changes
      public void CommitClaimMessagingStatisticsActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        DirectEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_ClaimMessagingStatisticsID,al.ToArray() );	
              
      }

      // End the ClaimMessagingStatistics BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndClaimMessagingStatisticsActivity()
      {
        // End this activity, no more data can be added.
        DirectEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_ClaimMessagingStatisticsID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_ClaimMessagingStatisticsID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_ClaimMessagingStatisticsID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string MessageType
      {
        set { _activityItemHashtable.Add(MessageTypeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[MessageTypeBAMFieldName]; }
      }

      public const string MessageTypeBAMFieldName = "MessageType";
 
      public string MessageDirection
      {
        set { _activityItemHashtable.Add(MessageDirectionBAMFieldName,value); }
        get { return (string)_activityItemHashtable[MessageDirectionBAMFieldName]; }
      }

      public const string MessageDirectionBAMFieldName = "MessageDirection";
 
      public string OrchestrationName
      {
        set { _activityItemHashtable.Add(OrchestrationNameBAMFieldName,value); }
        get { return (string)_activityItemHashtable[OrchestrationNameBAMFieldName]; }
      }

      public const string OrchestrationNameBAMFieldName = "OrchestrationName";
 
      public DateTime MessageStartTime
      {
        set { _activityItemHashtable.Add(MessageStartTimeBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[MessageStartTimeBAMFieldName]; }
      }

      public const string MessageStartTimeBAMFieldName = "MessageStartTime";
 
      public DateTime MessageEndTime
      {
        set { _activityItemHashtable.Add(MessageEndTimeBAMFieldName,value); }
        get { return (DateTime)_activityItemHashtable[MessageEndTimeBAMFieldName]; }
      }

      public const string MessageEndTimeBAMFieldName = "MessageEndTime";
 
      public string MessageSource
      {
        set { _activityItemHashtable.Add(MessageSourceBAMFieldName,value); }
        get { return (string)_activityItemHashtable[MessageSourceBAMFieldName]; }
      }

      public const string MessageSourceBAMFieldName = "MessageSource";
 
      public string MessageDestination
      {
        set { _activityItemHashtable.Add(MessageDestinationBAMFieldName,value); }
        get { return (string)_activityItemHashtable[MessageDestinationBAMFieldName]; }
      }

      public const string MessageDestinationBAMFieldName = "MessageDestination";
 
      public decimal NumberOfChildMessages
      {
        set { _activityItemHashtable.Add(NumberOfChildMessagesBAMFieldName,value); }
        get { return (decimal)_activityItemHashtable[NumberOfChildMessagesBAMFieldName]; }
      }

      public const string NumberOfChildMessagesBAMFieldName = "NumberOfChildMessages";
 
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public string MessageCommunicationMethod
      {
        set { _activityItemHashtable.Add(MessageCommunicationMethodBAMFieldName,value); }
        get { return (string)_activityItemHashtable[MessageCommunicationMethodBAMFieldName]; }
      }

      public const string MessageCommunicationMethodBAMFieldName = "MessageCommunicationMethod";
 
      public const string ActivityName = "ClaimMessagingStatistics";
      private string _ClaimMessagingStatisticsID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the EDI_Correlation BAM activity
  
    public class EDI_Correlation
    {
      public EDI_Correlation(string EDI_CorrelationID)
      {
        _EDI_CorrelationID = EDI_CorrelationID;
      } 

      public string ActivityID
      {
        get { return _EDI_CorrelationID; }
      }	

      // Begin the EDI_Correlation BAM activity
      public void BeginEDI_CorrelationActivity()
      {			
        // Begin the Activity using the passed identifier
        DirectEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_EDI_CorrelationID);
        
      }

      // Write any data changes to the _EDI_Correlation activity
      // This must be called post any property changes
      public void CommitEDI_CorrelationActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        DirectEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_EDI_CorrelationID,al.ToArray() );	
              
      }

      // End the EDI_Correlation BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndEDI_CorrelationActivity()
      {
        // End this activity, no more data can be added.
        DirectEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_EDI_CorrelationID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EDI_CorrelationID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EDI_CorrelationID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public string ISA13_New_InterchangeControlNumber
      {
        set { _activityItemHashtable.Add(ISA13_New_InterchangeControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA13_New_InterchangeControlNumberBAMFieldName]; }
      }

      public const string ISA13_New_InterchangeControlNumberBAMFieldName = "ISA13_New_InterchangeControlNumber";
 
      public string ISA13_Original_InterchangeControlNumber
      {
        set { _activityItemHashtable.Add(ISA13_Original_InterchangeControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA13_Original_InterchangeControlNumberBAMFieldName]; }
      }

      public const string ISA13_Original_InterchangeControlNumberBAMFieldName = "ISA13_Original_InterchangeControlNumber";
 
      public string GS06_New_GroupConrolNumber
      {
        set { _activityItemHashtable.Add(GS06_New_GroupConrolNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS06_New_GroupConrolNumberBAMFieldName]; }
      }

      public const string GS06_New_GroupConrolNumberBAMFieldName = "GS06_New_GroupConrolNumber";
 
      public string GS06_Original_GroupControlNumber
      {
        set { _activityItemHashtable.Add(GS06_Original_GroupControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS06_Original_GroupControlNumberBAMFieldName]; }
      }

      public const string GS06_Original_GroupControlNumberBAMFieldName = "GS06_Original_GroupControlNumber";
 
      public string ST02_New_TransactionSetControlNumber
      {
        set { _activityItemHashtable.Add(ST02_New_TransactionSetControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ST02_New_TransactionSetControlNumberBAMFieldName]; }
      }

      public const string ST02_New_TransactionSetControlNumberBAMFieldName = "ST02_New_TransactionSetControlNumber";
 
      public string ST02_Original_TransactionSetControlNumber
      {
        set { _activityItemHashtable.Add(ST02_Original_TransactionSetControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ST02_Original_TransactionSetControlNumberBAMFieldName]; }
      }

      public const string ST02_Original_TransactionSetControlNumberBAMFieldName = "ST02_Original_TransactionSetControlNumber";
 
      public string BTSMessageID_Original
      {
        set { _activityItemHashtable.Add(BTSMessageID_OriginalBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageID_OriginalBAMFieldName]; }
      }

      public const string BTSMessageID_OriginalBAMFieldName = "BTSMessageID_Original";
 
      public string ST01_TransactionSetIDCode
      {
        set { _activityItemHashtable.Add(ST01_TransactionSetIDCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ST01_TransactionSetIDCodeBAMFieldName]; }
      }

      public const string ST01_TransactionSetIDCodeBAMFieldName = "ST01_TransactionSetIDCode";
 
      public string BTSInterchangeID_Original
      {
        set { _activityItemHashtable.Add(BTSInterchangeID_OriginalBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeID_OriginalBAMFieldName]; }
      }

      public const string BTSInterchangeID_OriginalBAMFieldName = "BTSInterchangeID_Original";
 
      public const string ActivityName = "EDI_Correlation";
      private string _EDI_CorrelationID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the EDI_Envelope_Interchange BAM activity
  
    public class EDI_Envelope_Interchange
    {
      public EDI_Envelope_Interchange(string EDI_Envelope_InterchangeID)
      {
        _EDI_Envelope_InterchangeID = EDI_Envelope_InterchangeID;
      } 

      public string ActivityID
      {
        get { return _EDI_Envelope_InterchangeID; }
      }	

      // Begin the EDI_Envelope_Interchange BAM activity
      public void BeginEDI_Envelope_InterchangeActivity()
      {			
        // Begin the Activity using the passed identifier
        DirectEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_EDI_Envelope_InterchangeID);
        
      }

      // Write any data changes to the _EDI_Envelope_Interchange activity
      // This must be called post any property changes
      public void CommitEDI_Envelope_InterchangeActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        DirectEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_EDI_Envelope_InterchangeID,al.ToArray() );	
              
      }

      // End the EDI_Envelope_Interchange BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndEDI_Envelope_InterchangeActivity()
      {
        // End this activity, no more data can be added.
        DirectEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_EDI_Envelope_InterchangeID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EDI_Envelope_InterchangeID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EDI_Envelope_InterchangeID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public string ISA01_AuthorizationQualifier
      {
        set { _activityItemHashtable.Add(ISA01_AuthorizationQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA01_AuthorizationQualifierBAMFieldName]; }
      }

      public const string ISA01_AuthorizationQualifierBAMFieldName = "ISA01_AuthorizationQualifier";
 
      public string ISA02_AuthorizationInformation
      {
        set { _activityItemHashtable.Add(ISA02_AuthorizationInformationBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA02_AuthorizationInformationBAMFieldName]; }
      }

      public const string ISA02_AuthorizationInformationBAMFieldName = "ISA02_AuthorizationInformation";
 
      public string ISA03_SecurityQualifier
      {
        set { _activityItemHashtable.Add(ISA03_SecurityQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA03_SecurityQualifierBAMFieldName]; }
      }

      public const string ISA03_SecurityQualifierBAMFieldName = "ISA03_SecurityQualifier";
 
      public string ISA04_SecurityInformation
      {
        set { _activityItemHashtable.Add(ISA04_SecurityInformationBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA04_SecurityInformationBAMFieldName]; }
      }

      public const string ISA04_SecurityInformationBAMFieldName = "ISA04_SecurityInformation";
 
      public string ISA05_SenderQualifier
      {
        set { _activityItemHashtable.Add(ISA05_SenderQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA05_SenderQualifierBAMFieldName]; }
      }

      public const string ISA05_SenderQualifierBAMFieldName = "ISA05_SenderQualifier";
 
      public string ISA06_SenderID
      {
        set { _activityItemHashtable.Add(ISA06_SenderIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA06_SenderIDBAMFieldName]; }
      }

      public const string ISA06_SenderIDBAMFieldName = "ISA06_SenderID";
 
      public string ISA07_ReceiverQualifier
      {
        set { _activityItemHashtable.Add(ISA07_ReceiverQualifierBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA07_ReceiverQualifierBAMFieldName]; }
      }

      public const string ISA07_ReceiverQualifierBAMFieldName = "ISA07_ReceiverQualifier";
 
      public string ISA08_ReceiverID
      {
        set { _activityItemHashtable.Add(ISA08_ReceiverIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA08_ReceiverIDBAMFieldName]; }
      }

      public const string ISA08_ReceiverIDBAMFieldName = "ISA08_ReceiverID";
 
      public string ISA09_Date
      {
        set { _activityItemHashtable.Add(ISA09_DateBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA09_DateBAMFieldName]; }
      }

      public const string ISA09_DateBAMFieldName = "ISA09_Date";
 
      public string ISA10_Time
      {
        set { _activityItemHashtable.Add(ISA10_TimeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA10_TimeBAMFieldName]; }
      }

      public const string ISA10_TimeBAMFieldName = "ISA10_Time";
 
      public string ISA11_ControlStandardsID
      {
        set { _activityItemHashtable.Add(ISA11_ControlStandardsIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA11_ControlStandardsIDBAMFieldName]; }
      }

      public const string ISA11_ControlStandardsIDBAMFieldName = "ISA11_ControlStandardsID";
 
      public string ISA13_InterchangeControlVersionNumber
      {
        set { _activityItemHashtable.Add(ISA13_InterchangeControlVersionNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA13_InterchangeControlVersionNumberBAMFieldName]; }
      }

      public const string ISA13_InterchangeControlVersionNumberBAMFieldName = "ISA13_InterchangeControlVersionNumber";
 
      public string ISA12_InterchangeControlNumber
      {
        set { _activityItemHashtable.Add(ISA12_InterchangeControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA12_InterchangeControlNumberBAMFieldName]; }
      }

      public const string ISA12_InterchangeControlNumberBAMFieldName = "ISA12_InterchangeControlNumber";
 
      public string ISA14_AcknowledgementRequested
      {
        set { _activityItemHashtable.Add(ISA14_AcknowledgementRequestedBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA14_AcknowledgementRequestedBAMFieldName]; }
      }

      public const string ISA14_AcknowledgementRequestedBAMFieldName = "ISA14_AcknowledgementRequested";
 
      public string ISA15_TestIndicator
      {
        set { _activityItemHashtable.Add(ISA15_TestIndicatorBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA15_TestIndicatorBAMFieldName]; }
      }

      public const string ISA15_TestIndicatorBAMFieldName = "ISA15_TestIndicator";
 
      public string ISA16_SubelementSeparator
      {
        set { _activityItemHashtable.Add(ISA16_SubelementSeparatorBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ISA16_SubelementSeparatorBAMFieldName]; }
      }

      public const string ISA16_SubelementSeparatorBAMFieldName = "ISA16_SubelementSeparator";
 
      public string DataElementSeparator
      {
        set { _activityItemHashtable.Add(DataElementSeparatorBAMFieldName,value); }
        get { return (string)_activityItemHashtable[DataElementSeparatorBAMFieldName]; }
      }

      public const string DataElementSeparatorBAMFieldName = "DataElementSeparator";
 
      public string SegmentTerminator
      {
        set { _activityItemHashtable.Add(SegmentTerminatorBAMFieldName,value); }
        get { return (string)_activityItemHashtable[SegmentTerminatorBAMFieldName]; }
      }

      public const string SegmentTerminatorBAMFieldName = "SegmentTerminator";
 
      public const string ActivityName = "EDI_Envelope_Interchange";
      private string _EDI_Envelope_InterchangeID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the EDI_Envelope_Group BAM activity
  
    public class EDI_Envelope_Group
    {
      public EDI_Envelope_Group(string EDI_Envelope_GroupID)
      {
        _EDI_Envelope_GroupID = EDI_Envelope_GroupID;
      } 

      public string ActivityID
      {
        get { return _EDI_Envelope_GroupID; }
      }	

      // Begin the EDI_Envelope_Group BAM activity
      public void BeginEDI_Envelope_GroupActivity()
      {			
        // Begin the Activity using the passed identifier
        DirectEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_EDI_Envelope_GroupID);
        
      }

      // Write any data changes to the _EDI_Envelope_Group activity
      // This must be called post any property changes
      public void CommitEDI_Envelope_GroupActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        DirectEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_EDI_Envelope_GroupID,al.ToArray() );	
              
      }

      // End the EDI_Envelope_Group BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndEDI_Envelope_GroupActivity()
      {
        // End this activity, no more data can be added.
        DirectEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_EDI_Envelope_GroupID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EDI_Envelope_GroupID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EDI_Envelope_GroupID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string GS01_FunctionalIDCode
      {
        set { _activityItemHashtable.Add(GS01_FunctionalIDCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS01_FunctionalIDCodeBAMFieldName]; }
      }

      public const string GS01_FunctionalIDCodeBAMFieldName = "GS01_FunctionalIDCode";
 
      public string GS02_ApplicationSenderCode
      {
        set { _activityItemHashtable.Add(GS02_ApplicationSenderCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS02_ApplicationSenderCodeBAMFieldName]; }
      }

      public const string GS02_ApplicationSenderCodeBAMFieldName = "GS02_ApplicationSenderCode";
 
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public string GS03_ApplicationReceiverCode
      {
        set { _activityItemHashtable.Add(GS03_ApplicationReceiverCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS03_ApplicationReceiverCodeBAMFieldName]; }
      }

      public const string GS03_ApplicationReceiverCodeBAMFieldName = "GS03_ApplicationReceiverCode";
 
      public string GS04_Date
      {
        set { _activityItemHashtable.Add(GS04_DateBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS04_DateBAMFieldName]; }
      }

      public const string GS04_DateBAMFieldName = "GS04_Date";
 
      public string GS05_Time
      {
        set { _activityItemHashtable.Add(GS05_TimeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS05_TimeBAMFieldName]; }
      }

      public const string GS05_TimeBAMFieldName = "GS05_Time";
 
      public string GS06_GroupControlNumber
      {
        set { _activityItemHashtable.Add(GS06_GroupControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS06_GroupControlNumberBAMFieldName]; }
      }

      public const string GS06_GroupControlNumberBAMFieldName = "GS06_GroupControlNumber";
 
      public string GS07_ResponsibleAgencyCode
      {
        set { _activityItemHashtable.Add(GS07_ResponsibleAgencyCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS07_ResponsibleAgencyCodeBAMFieldName]; }
      }

      public const string GS07_ResponsibleAgencyCodeBAMFieldName = "GS07_ResponsibleAgencyCode";
 
      public string GS08_VersionIDCode
      {
        set { _activityItemHashtable.Add(GS08_VersionIDCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[GS08_VersionIDCodeBAMFieldName]; }
      }

      public const string GS08_VersionIDCodeBAMFieldName = "GS08_VersionIDCode";
 
      public const string ActivityName = "EDI_Envelope_Group";
      private string _EDI_Envelope_GroupID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the EDI_Envelope_Transaction BAM activity
  
    public class EDI_Envelope_Transaction
    {
      public EDI_Envelope_Transaction(string EDI_Envelope_TransactionID)
      {
        _EDI_Envelope_TransactionID = EDI_Envelope_TransactionID;
      } 

      public string ActivityID
      {
        get { return _EDI_Envelope_TransactionID; }
      }	

      // Begin the EDI_Envelope_Transaction BAM activity
      public void BeginEDI_Envelope_TransactionActivity()
      {			
        // Begin the Activity using the passed identifier
        DirectEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_EDI_Envelope_TransactionID);
        
      }

      // Write any data changes to the _EDI_Envelope_Transaction activity
      // This must be called post any property changes
      public void CommitEDI_Envelope_TransactionActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        DirectEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_EDI_Envelope_TransactionID,al.ToArray() );	
              
      }

      // End the EDI_Envelope_Transaction BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndEDI_Envelope_TransactionActivity()
      {
        // End this activity, no more data can be added.
        DirectEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_EDI_Envelope_TransactionID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EDI_Envelope_TransactionID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_EDI_Envelope_TransactionID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string ST01_TransactionSetIDCode
      {
        set { _activityItemHashtable.Add(ST01_TransactionSetIDCodeBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ST01_TransactionSetIDCodeBAMFieldName]; }
      }

      public const string ST01_TransactionSetIDCodeBAMFieldName = "ST01_TransactionSetIDCode";
 
      public string ST02_TransactionSetControlNumber
      {
        set { _activityItemHashtable.Add(ST02_TransactionSetControlNumberBAMFieldName,value); }
        get { return (string)_activityItemHashtable[ST02_TransactionSetControlNumberBAMFieldName]; }
      }

      public const string ST02_TransactionSetControlNumberBAMFieldName = "ST02_TransactionSetControlNumber";
 
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public const string ActivityName = "EDI_Envelope_Transaction";
      private string _EDI_Envelope_TransactionID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    #region Helper class for the MessageLog BAM activity
  
    public class MessageLog
    {
      public MessageLog(string MessageLogID)
      {
        _MessageLogID = MessageLogID;
      } 

      public string ActivityID
      {
        get { return _MessageLogID; }
      }	

      // Begin the MessageLog BAM activity
      public void BeginMessageLogActivity()
      {			
        // Begin the Activity using the passed identifier
        DirectEventStream es = GetEventStream();
        es.BeginActivity(ActivityName ,_MessageLogID);
        
      }

      // Write any data changes to the _MessageLog activity
      // This must be called post any property changes
      public void CommitMessageLogActivity()
      {
        // We need to provide the key/value pairs to the BAM API
        ArrayList al = new ArrayList();								
        foreach (DictionaryEntry de in _activityItemHashtable)
        {
          al.Add(de.Key);
          al.Add(de.Value);
        }
        			
        // Update the BAM Activity with all of the data
        DirectEventStream es = GetEventStream();
        es.UpdateActivity(ActivityName,_MessageLogID,al.ToArray() );	
              
      }

      // End the MessageLog BAM activity, no more changes will be permitted to this activity unless continuation is used
      public void EndMessageLogActivity()
      {
        // End this activity, no more data can be added.
        DirectEventStream es = GetEventStream();
        es.EndActivity(ActivityName,_MessageLogID);
      }

      // Add a reference from this activity to another activity
      public void AddReferenceToAnotherActivity(string OtherActivityName, string OtherActivityID)
      {
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_MessageLogID,"Activity",OtherActivityName,OtherActivityID);
      }

      // Add a custom reference to this activity, this enables "data" to be attached to an activity such as a message body
      public void AddCustomReference(string referenceName, string referenceType, string referenceData, string longReferenceData)
      { 
        // Add a reference to another activity
        DirectEventStream es = GetEventStream();
        es.AddReference(ActivityName,_MessageLogID,referenceName,referenceType,referenceData, longReferenceData);
      }

      
      public string BTSMessageID
      {
        set { _activityItemHashtable.Add(BTSMessageIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSMessageIDBAMFieldName]; }
      }

      public const string BTSMessageIDBAMFieldName = "BTSMessageID";
 
      public string BTSInterchangeID
      {
        set { _activityItemHashtable.Add(BTSInterchangeIDBAMFieldName,value); }
        get { return (string)_activityItemHashtable[BTSInterchangeIDBAMFieldName]; }
      }

      public const string BTSInterchangeIDBAMFieldName = "BTSInterchangeID";
 
      public string CurrentStep
      {
        set { _activityItemHashtable.Add(CurrentStepBAMFieldName,value); }
        get { return (string)_activityItemHashtable[CurrentStepBAMFieldName]; }
      }

      public const string CurrentStepBAMFieldName = "CurrentStep";
 
      public string CurrentStepDetails
      {
        set { _activityItemHashtable.Add(CurrentStepDetailsBAMFieldName,value); }
        get { return (string)_activityItemHashtable[CurrentStepDetailsBAMFieldName]; }
      }

      public const string CurrentStepDetailsBAMFieldName = "CurrentStepDetails";
 
      public string NextStep
      {
        set { _activityItemHashtable.Add(NextStepBAMFieldName,value); }
        get { return (string)_activityItemHashtable[NextStepBAMFieldName]; }
      }

      public const string NextStepBAMFieldName = "NextStep";
 
      public const string ActivityName = "MessageLog";
      private string _MessageLogID = null;
      private Hashtable _activityItemHashtable = new Hashtable();
    }
  
  #endregion

    // Return the EventStream in use
    public static DirectEventStream GetEventStream()
    {		
      return new DirectEventStream("Integrated Security=SSPI;Data Source=.;Initial Catalog=BAMPrimaryImport",1);
    }
    
  }
}
